
import os
import yaml
import traceback


def loadYaml(file_path):
    if not os.path.exists(file_path):
        print("Error: %s not exists"%file_path)
        return None
    yaml_data=None
    try:
        with open(file_path) as f:
            yaml_data=yaml.safe_load(f.read())
    except:
        print("Some error occured,the exception message is:")
        print(traceback.format_exc())
    return yaml_data